package com.winning.jsyd.quarzt.job;

import com.winning.jsyd.controller.UDController;
import com.winning.jsyd.entity.enums.ServiceEnum;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * 糖尿病报告卡
 *
 * @author z_dd@winning.com.cn
 * @date 2019/6/24 9:45
 */
@DisallowConcurrentExecution
public class DmDiabetesReportJob extends QuartzJobBean {
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        ApplicationContext applicationContext =
                (ApplicationContext) jobExecutionContext
                        .getMergedJobDataMap().get("applicationContext");
        UDController udc = (UDController) applicationContext.getBean("udc");

        udc.task(ServiceEnum.DmDiabetesReport);
    }
}
